package nc.ui.tc.tools.pubclass;

import java.awt.Component;
import nc.ui.ml.NCLangRes;
import nc.ui.pub.FuncNodeStarter;
import nc.ui.pub.beans.MessageDialog;
import nc.ui.pub.linkoperate.ILinkQueryData;
import nc.ui.sm.login.ClientAssistant;
import nc.ui.sm.power.FuncRegister;
import nc.ui.uap.sf.SFClientUtil;
import nc.vo.sm.funcreg.FuncRegisterVO;
public class OpenNode extends SFClientUtil{
	public OpenNode(String funCode,Object obj){
		LinkQueryData data=new LinkQueryData(obj);		
		 if (funCode != null) {
	    	 FuncRegisterVO frVO = findFRVOFromMenuTree(funCode);
	         if (frVO == null) {
	           frVO = FuncRegister.getFuncRegisterVOByCode(funCode);
	         }
	      if (frVO != null)
	        FuncNodeStarter.openLinkedDialog(frVO, 3, data, null, false, true, null);
	      else {
	        MessageDialog.showErrorDlg(ClientAssistant.getApplet(), NCLangRes.getInstance().getStrByID("sysframev5", "UPPsysframev5-000062"), NCLangRes.getInstance().getStrByID("sysframev5", "UPPsysframev5-000095") + funCode);
	      }
	    }
	    else
	    {
	      System.out.println("funcCode is null, can't open funnode");
	    }
	}
	
	public OpenNode(String funCode,ILinkQueryData data){
		 if (funCode != null) {
	    	 FuncRegisterVO frVO = findFRVOFromMenuTree(funCode);
	         if (frVO == null) {
	           frVO = FuncRegister.getFuncRegisterVOByCode(funCode);
	         }
	      if (frVO != null)
	        FuncNodeStarter.openLinkedDialog(frVO, 3, data, null, false, true, null);
	      else {
	        MessageDialog.showErrorDlg(ClientAssistant.getApplet(), NCLangRes.getInstance().getStrByID("sysframev5", "UPPsysframev5-000062"), NCLangRes.getInstance().getStrByID("sysframev5", "UPPsysframev5-000095") + funCode);
	      }
	    }
	    else
	    {
	      System.out.println("funcCode is null, can't open funnode");
	    }
	}
	
	public OpenNode(String funCode, Component parent, ILinkQueryData data) {
		 if (funCode != null) {
	    	 FuncRegisterVO frVO = findFRVOFromMenuTree(funCode);
	         if (frVO == null) {
	           frVO = FuncRegister.getFuncRegisterVOByCode(funCode);
	         }
	      if (frVO != null)
	        FuncNodeStarter.openLinkedDialog(frVO, 3, data, parent, false, true, null);
	      else {
	        MessageDialog.showErrorDlg(ClientAssistant.getApplet(), NCLangRes.getInstance().getStrByID("sysframev5", "UPPsysframev5-000062"), NCLangRes.getInstance().getStrByID("sysframev5", "UPPsysframev5-000095") + funCode);
	      }
	    }
	    else
	    {
	      System.out.println("funcCode is null, can't open funnode");
	    }
	}
}

